import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;

//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static void main(String[] args) throws InvocationTargetException, IllegalAccessException, ClassNotFoundException, NoSuchMethodException, InstantiationException {
        Object o=(Class.forName("AnnotationExample2").getDeclaredConstructor().newInstance());
        System.out.println(o.getClass().getSuperclass());
        for(Method method: o.getClass().getDeclaredMethods()) {
            MyAnnotation annotation = method.getAnnotation(MyAnnotation.class);
            if(annotation != null) {
                System.out.println(annotation+":"+annotation.value());
            }
            List.of(method.getParameters()).forEach(System.out::println);
            method.invoke(o);
        }
    }
}
